//
// Created by 11510 on 2024/7/29.
//

#ifndef DICTIONARY_SPLITTOOLCPPJIEBA_H
#define DICTIONARY_SPLITTOOLCPPJIEBA_H

#include "SplitTool.h"
#include "Configuration.h"
#include "simhash/Simhasher.hpp"

class Simhasher{
private:
    simhash::Simhasher* simhasher;
public:

    Simhasher(const Configuration &configuration) {
        simhasher = new simhash::Simhasher(configuration.getDictPath(),
                                           configuration.getHmmPath(),
                                           configuration.getIdfPath(),
                                           configuration.getStopWordPath());
    }

    ~Simhasher(){
        if(simhasher){
            delete simhasher;
            simhasher = nullptr;
        }
    }

    void make(const std::string &sentence, size_t topN, uint64_t& u64){
        simhasher->make(sentence, topN, u64);
    }
};


#endif //DICTIONARY_SPLITTOOLCPPJIEBA_H
